// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import settings from "./settings";
import {getRequest} from './utils/api';
import {postRequest} from './utils/api';
import {putRequest} from './utils/api';
import {deleteRequest} from './utils/api';


// 设置生产环境不提示
Vue.config.productionTip = false


// Vue加入全局配置
Vue.prototype.$settings = settings

// 加入自定义的axios方法
Vue.prototype.$getRequest = getRequest
Vue.prototype.$postRequest = postRequest
Vue.prototype.$putRequest = putRequest
Vue.prototype.$deleteRequest = deleteRequest

// 加入element-ui插件
// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
// // 调用插件
// Vue.use(ElementUI)

// // 加入iView插件
// import iView from 'iview';
// import 'iview/dist/styles/iview.css'
// Vue.use(iView)

// 加入iView插件
import ViewUI from 'view-design';
// import style
import 'view-design/dist/styles/iview.css';
Vue.use(ViewUI)

// 导入全局的CSS初始化样式
import '../static/css/reset.css';

// // 加入axios插件
// import axios from "axios";
// // 允许ajax请求时附带cookie
// axios.defaults.withCredentials = false
// Vue.prototype.$axios = axios

//加入highlight.js代码高亮
//这里有多个样式，自己可以根据需要切换
import VueHighlightJS from 'vue-highlightjs';
import "highlight.js/styles/atom-one-dark.css";

//use
Vue.use(VueHighlightJS)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  // 加载路由
  router,
  components: { App },
  template: '<App/>',

  // 引入全局事件总线
  beforeCreate() {
    Vue.prototype.$bus = this
  }
})
